diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-12-09 03:57:12 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-12-09 03:57:12 +0100 |
| commit | 4dbef3fcd7a14437d55c555cf10d50de8e50d7d1 (patch) | |
| tree | 632589ecfcfb4dfddeafb71d0077257584b5e7ec /code/app/src/routes/(main)/(public)/reset-password/[id] | |
| parent | 914c75e0ceeb3e11ddd55e94bb461c26b0db5b7a (diff) | |
| download | greatoffice-4dbef3fcd7a14437d55c555cf10d50de8e50d7d1.tar.xz greatoffice-4dbef3fcd7a14437d55c555cf10d50de8e50d7d1.zip | |
feat: Move everything out of $lib
Diffstat (limited to 'code/app/src/routes/(main)/(public)/reset-password/[id]')
| -rw-r--r-- | code/app/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts | 10 | ||||
| -rw-r--r-- | code/app/src/routes/(main)/(public)/reset-password/[id]/+page.svelte | 33 |
2 files changed, 22 insertions, 21 deletions
diff --git a/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts index 389d04c..907b444 100644 --- a/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts +++ b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts @@ -1,11 +1,11 @@ -import { is_guid } from '$lib/helpers'; -import { redirect } from '@sveltejs/kit'; -import type { PageServerLoad } from './$types'; +import {is_guid} from "$help"; +import {redirect} from "@sveltejs/kit"; +import type {PageServerLoad} from "./$types"; -export const load: PageServerLoad = async ({ params }) => { +export const load: PageServerLoad = async ({params}) => { const resetRequestId = params.id ?? ""; if (!is_guid(resetRequestId)) throw redirect(302, "/reset-password"); return { - resetRequestId + resetRequestId, }; };
\ No newline at end of file diff --git a/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.svelte b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.svelte index ba59a8f..8f817bf 100644 --- a/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.svelte +++ b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.svelte @@ -1,11 +1,11 @@ <script lang="ts"> - import { onMount } from "svelte"; - import LL from "$lib/i18n/i18n-svelte"; - import { Alert, Input, Button } from "$lib/components"; - import type { PageServerData } from "./$types"; - import { goto } from "$app/navigation"; - import { SignInPageMessage, signInPageMessageQueryKey } from "$routes/(main)/(public)/sign-in"; - import { PasswordResetService } from "$lib/services/password-reset-service"; + import {onMount} from "svelte"; + import LL from "$i18n/i18n-svelte"; + import {Alert, Input, Button} from "$components"; + import type {PageServerData} from "./$types"; + import {goto} from "$app/navigation"; + import {SignInPageMessage, signInPageMessageQueryKey} from "$routes/(main)/(public)/sign-in"; + import {PasswordResetService} from "$services/password-reset-service"; export let data: PageServerData; const passwordResets = new PasswordResetService(); @@ -57,18 +57,19 @@ <div class="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10"> <form class="space-y-6" on:submit|preventDefault={submitFormAsync}> {#if requestIsInvalid} - <Alert title={$LL.resetPasswordPage.invalidRequestTitle()} message={$LL.resetPasswordPage.invalidRequestMessage()} /> + <Alert title={$LL.resetPasswordPage.invalidRequestTitle()} + message={$LL.resetPasswordPage.invalidRequestMessage()}/> {/if} <Input - id="password" - name="password" - type="password" - autocomplete="new-password" - required - bind:value={formData.newPassword.value} - label={$LL.resetPasswordPage.newPassword()} + id="password" + name="password" + type="password" + autocomplete="new-password" + required + bind:value={formData.newPassword.value} + label={$LL.resetPasswordPage.newPassword()} /> - <Button text={$LL.submit()} type="submit" {loading} fullWidth /> + <Button text={$LL.submit()} type="submit" {loading} fullWidth/> </form> </div> </div> |
